<?php echo $header; ?>
<?php echo $banner; ?>
<script>
<?php if(isset($orderlist) && $orderlist != '' && html_entity_decode($orderlist) != '{"list":[]}'){
    echo 'var selectedMenu = '.html_entity_decode($orderlist).'.list;';
}else{
    echo 'var selectedMenu = null;';
}
echo 'var userid = '.$userid.';';
echo 'var category_id = '.$category_id.';';
echo 'var featuredMenu = '. json_encode($features) . ';';
echo 'var hasAddress = '.$hasAddress.';';
echo 'var hasAddressId = '.$hasAddressId.';';
echo 'var pid = '.$pid.';';
?>
</script>
<div id="bd" role="main">
    <div id="yui-main">
        <div class="yui-b">
            <div class="yui-g" style="position:relative;">
                <div id="idx_menu_mask"></div>
                <div id="idx_menu" class="main-module">
                    <div class="hd"><h2>菜单 Menu</h2></div>
                    <div class="bd">
                        <div class="dy-menu" id="idx_menu_subtab">
                            <ul class="clearfix first">
                                <?php 
                                
                                foreach ($categories1 as $child) { ?>
                                    <?php if ($child['category_id'] == $category_id) { ?>
                                    <li data-cid="<?php echo $child['category_id']; ?>" class="category-tab on"><a href="./index.php?route=common/home&path=<?php echo $child['category_id']; ?>"><?php echo $child['name']; ?></a></li>
                                    <?php } else { ?>
                                    <li data-cid="<?php echo $child['category_id']; ?>" class="category-tab"><a href="./index.php?route=common/home&path=<?php echo $child['category_id']; ?>"><?php echo $child['name']; ?></a></li>
                                    <?php } ?>
                                <?php } ?>
                            </ul>
                            <ul class="clearfix">
                                <?php 
                                
                                foreach ($categories2 as $child) { ?>
                                    <?php if ($child['category_id'] == $category_id) { ?>
                                    <li data-cid="<?php echo $child['category_id']; ?>" class="category-tab on"><a href="./index.php?route=common/home&path=<?php echo $child['category_id']; ?>"><?php echo $child['name']; ?></a></li>
                                    <?php } else { ?>
                                    <li data-cid="<?php echo $child['category_id']; ?>" class="category-tab"><a href="./index.php?route=common/home&path=<?php echo $child['category_id']; ?>"><?php echo $child['name']; ?></a></li>
                                    <?php } ?>
                                <?php } ?>
                            </ul>
                        </div>
                        <div class="category-panel">
                            <ul class="clearfix">
                            </ul>
                        </div>
                    </div>
                    <div class="ft"></div>
                </div> 
                
                <div id="idx_detail" class="main-module">
                    <div class="hd"><h2>产品详情 Detail</h2><a href="#">返回，继续点餐</a></div>
                    <div class="bd">
                    </div>
                    <div class="ft"></div>
                </div> 
                
            </div>
        </div>
    </div>
    <div class="yui-b">
        <!-- YOUR NAVIGATION GOES HERE -->
        <div id="side-nav">
            <div id="side-member" class="side-module">
                <?php if (!$logged) { ?>
                <div class="nologin">
                    <div class="hd">
                        <a href="#" class="lnk-login">登录</a>&nbsp;
                        <a href="index.php?route=account/register" class="lnk-reg">注册</a>
                    </div>
                    <div class="bd start-order">
                        <a href="#" class="lnk-order">立刻订餐</a>
                        <p>订单确认后</br>60分钟内送达</br><span>预约订餐(接受7天以内订餐)</span></p>
                    </div>
                </div>
                <div class="login" style="display:none;">
                    <div class="hd"></div>
                    <div class="bd">
                        <form action="index.php?route=account/login" method="post" enctype="multipart/form-data" id="form-login">
                        <ul>
                            <li class="clearfix">
                                <label>用户名</label><input type="text" name="email" value=""/>
                            </li>
                            <li class="clearfix">
                                <label>密码</label><input type="password" name="password" value=""/>&nbsp;&nbsp;<a class="btn-forget" href="index.php?route=account/forgotten">忘记密码？</a>
                            </li>
                            <li class="btn">
                                <a href="javascript:void()" onclick="$('#form-login').submit();" class="btn-login">登录</a>&nbsp;&nbsp;
                                <a href="index.php?route=account/register" class="btn-reg">立刻注册</a>
                            </li>
                        </ul>
                        </form>
                    </div>
                </div>
                <?php } else { ?>
                <div class="haslogin">
                    <div class="hd">
                        <a href="index.php?route=account/logout" class="tool">&nbsp;退出</a> 
                        <a href="index.php?route=common/my" class="tool">&nbsp;我的鼎宴&nbsp;</a>
                        Hi! <?php echo $firstname; ?> 
                    </div>
                    <div class="bd start-order" style="display:block;">
                        <a href="#" class="lnk-order">立刻订餐</a>
                        <p>订单确认后</br>60分钟内送达</br><span>预约订餐(接受7天以内订餐)</span></p>
                    </div>
                    <div id="side-order" class="bd" style="display:none;">
                        <div class="dy-tab">
                            <ul class="dy-tab-menu clearfix">
                                <li class="on"><a href="#">我的订单</a></li>
                                <li><a href="#">我的菜单</a></li>
                            </ul>
                            <div class="dy-tab-panel order-info form">
                                <form id="form-order-info">
                                <div class="section">
                                    <div class="subject">
                                        <strong>送餐地址 <a href="index.php?route=account/address" class="tool"> - [管理]</a></strong>
                                    </div>
                                    <ul class="detail">
                                    <?php foreach ($addresses as $result) { ?>
                                        <?php if ($result['address_id'] == $address_id) { ?>
                                        <li><input type="radio" name="address" checked value="<?php echo $result['address_id']; ?>"> <?php echo $result['address']; ?></li>
                                        <?php } else { ?>
                                        <li><input type="radio" name="address" value="<?php echo $result['address_id']; ?>"> <?php echo $result['address']; ?></li>
                                        <?php } ?>
                                    <?php } ?>
                                    </ul>
                                </div>
                                <div class="section">
                                    <div class="subject">
                                        <strong>送餐时间</strong>
                                    </div>
                                    <ul class="detail">
                                        <li><input type="radio" name="shipping" value="0" <?php if ($shipping_date == 0) { echo 'checked'; } ?> > 订单确认后60分钟内送达</li>
                                        <li>
                                            <input type="radio" name="shipping" value="1" <?php if ($shipping_date != 0) { echo 'checked'; } ?> > 7天内预约 &nbsp;&nbsp;&nbsp;&nbsp;
                                            <?php $_shipping_datetime = explode(' ', $shipping_date); ?>
                                            <select name="shipping_date">
                                            <?php for($i=0;$i<8;$i++){ $_date = date('Y-m-d',time()+86400*$i); ?>
                                                <option <?php if ($_shipping_datetime[0] == $_date) { echo 'selected'; } ?> ><?php echo $_date; ?></option>
                                            <?php }?>
                                            </select> 
                                            <select name="shipping_time">
                                            <?php for($i=11;$i<21;$i++){?>
                                                <option <?php if (isset($_shipping_datetime[1]) && $_shipping_datetime[1] == $i.':00') { echo 'selected'; } ?> ><?php echo $i.':00'; ?></option>
                                                <option <?php if (isset($_shipping_datetime[1]) && $_shipping_datetime[1] == $i.':30') { echo 'selected'; } ?> ><?php echo $i.':30'; ?></option>
                                            <?php }?>
                                            </select>
                                        </li>
                                    </ul>
                                </div>
                                <div class="section">
                                    <div class="subject">
                                        <strong>用餐人数</strong> &nbsp;&nbsp;&nbsp;&nbsp;
                                        <select name="people_num">
                                            <?php for($i=0;$i<10;$i++){ ?>
                                                <?php if($people_num == ($i+1)){ ?>
                                                    <option value="<?php echo ($i+1);?>" selected ><?php echo ($i+1);?></option>
                                                <?php }else{ ?>
                                                    <option value="<?php echo ($i+1);?>" ><?php echo ($i+1);?></option>
                                                <?php } ?>
                                            <?php } ?>
                                        </select>
                                        <span class="tip">* 人均消费满58元，免餐具费用；餐具费3元/位</span>
                                    </div>
                                    <ul class="detail">
                                        <li></li>
                                    </ul>
                                </div>
                                <div class="section">
                                    <div class="subject">
                                        <strong>是否需要配送电磁炉</strong>&nbsp;&nbsp;&nbsp;&nbsp;
                                        <?php if ($dcl == '0') { ?>
                                            <input type="radio" name="dcl" value="1"> 是&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="dcl"  value="0" checked> 否
                                        <?php } else { ?>
                                            <input type="radio" name="dcl" value="1" checked> 是&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="dcl"  value="0" > 否
                                        <?php } ?>
                                    </div>
                                    <ul class="detail">
                                        <li></li>
                                    </ul>
                                </div>
                                <div class="note-sm">
                                    * 有问题请联系0755-234325, 或<a target="_blank" href="http://wpa.qq.com/msgrd?v=3&uin=2541645747&site=qq&menu=yes">在线聊天</a>
                                </div>
                                <div class="form-btn clearfix">
                                    <a href="#" class="btn-cancel-order">取消 Cancel</a>
                                    <a href="#" id="btn-order-s1" class="next">下一步 Next</a>
                                </div>
                                </form>
                                <div id="side-note">
                                    <h4>订餐须知</h4>
                                    <p>配 &nbsp;送 &nbsp;费： <strong>12元</strong>（促销活动及超值套餐除外）</p>
                                    <p>起送金额： <strong>168.00元</strong></p>
                                    <p>配送时间： <strong>11:00~21:00</strong></p>
                                    <p>配送范围： <a href="index.php?route=new/new&new_id=3" target="_blank" >送餐范围</a>内60分钟到达！未在派送范围的，请提醒我们尽快开通！</p>
                                </div>
                            </div>
                            <div class="dy-tab-panel order-menu">
                                <div class="note">
                                    提示: 根据你最终提交订单的时间，送餐时间可能略有调整
                                </div>
                                <table class="green-table">
                                    <tr class="header">
                                        <td class="name">品名<span>Name</span></td>
                                        <td class="quantity">数量<span>Num.</span></td>
                                        <td class="cost">价格<span>Price</span></td>
                                        <td class="cancel">取消<span>Cancel</span></td>
                                    </tr>
                                </table>
                                <div class="scroll-wrap">
                                    <table class="green-table menu-table">
                                    </table>
                                </div>
                                <div class="clearfix">
                                    <a href="#" class="btn-clearall">全部清空</a>
                                </div>
                                <div class="count clearfix">
                                    <span>0元</span>小计/Subtotal
                                </div>
                                <div class="count clearfix">
                                    <span>0元</span>外送费/Delivery Fee
                                </div>
                                <div class="count clearfix">
                                    <span>0元</span>合计/Total
                                </div>
                                <div class="note-sm">
                                   * 有问题请联系0755-234325, 或<a target="_blank" href="http://wpa.qq.com/msgrd?v=3&uin=2541645747&site=qq&menu=yes">在线聊天</a>
                                </div>
                                <div class="form-btn clearfix">
                                    <form action="index.php?route=checkout/cart" method="post" enctype="multipart/form-data" id="form-confirm">
                                        <a href="#" class="btn-cancel-order">取消 Cancel</a>
                                        <a id="btn-order-s2" href="javascript:void();" class="next" >下一步 Next</a>
                                        <input type="hidden" name="products"  id="form-confirm-products">
                                    </form>
                                </div>
                                <div id="side-note">
                                    <h4>订餐须知</h4>
                                    <p>1）一次性餐具：一次性保鲜盒、铝箔袋、荷包纸巾、用餐四件套。
                                    须回收餐具：电磁炉、锅、汤勺、漏勺、插线板、垃圾框以及回收保鲜盒；
                                    须回收餐具不收取押金，只需要在<a target="_blank" href="index.php?route=new/new&new_id=1">《用餐餐具押金凭证》</a>确认单上签字，并遵守<a target="_blank" href="index.php?route=new/new&new_id=2">《餐具损坏及丢失赔偿指引》</a>。</p>
                                    <p>2）回收餐具：用完餐致电我们回收餐具，我们会在1小时内上门回收餐具。</p>
                                </div>
                            </div>
                        </div>
                        
                    </div>
                    <div class="ft"><a href="index.php?route=common/help">查看更多</a></div>
                </div>
                <?php } ?>
                
            </div>
            
            <div id="side-feature">
                <div class="hd"><a href="#">换一换</a>人气推荐</div>
                <div class="bd">
                    
                </div>
                <div class="ft contact"><span>每日10:00~21:00 <a target="_blank" href="http://wpa.qq.com/msgrd?v=3&uin=2541645747&site=qq&menu=yes">在线聊天</a></span></div>
                <iframe width="315" height="280" class="share_self"  frameborder="0" scrolling="no" src="http://widget.weibo.com/weiboshow/index.php?language=&width=315&height=280&fansRow=2&ptype=1&speed=0&skin=-1&isTitle=0&noborder=0&isWeibo=1&isFans=0&uid=2617757911&verifier=4bcb5564&colors=d6f3f7,FDF9D7,603317,6AA525,ecfbfd&dpc=1"></iframe>
            
            </div>
            <div id="side-help" class="side-module">
                <div class="hd"><h2>帮助中心 Help Desk</h2></div>
                <div class="bd">
                    <ul>
                        <li class="s1"><a href="index.php?route=common/help&s=1">新手入门</a></li>
                        <li class="s2"><a href="index.php?route=common/help&s=2">常见问题</a></li>
                        <li class="s3"><a href="index.php?route=common/help&s=3">支付方式</a></li>
                    </ul>
                </div>
                <div class="ft"></div>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript" src="catalog/view/javascript/index.js"></script>
<?php echo $footer; ?>